<template>
  <div>
    <!-- 头部部分 -->
    <header class="header">
      <h1>todos</h1>
      <input class="new-todo" placeholder="请输入任务名称" autofocus v-model="taskname" @keydown.enter="hAdd"/>
    </header>
  </div>
</template>

<script>
export default {
  name: 'VueDemoTodoHeader',

  data() {
    return {
      taskname:''
    };
  },

  mounted() {
    
  },

  methods: {
    hAdd(){
      this.$emit('hAddtask',this.taskname)
      this.taskname=''
    }
  },
};
</script>

<style lang="scss" scoped>

</style>